<template>
  <div class="main">
    <el-container>
      <el-header class="header">
        <div class="logo">
          <h1>logo</h1>
        </div>
        <div class="userInfo">
          <el-dropdown>
            <span class="el-dropdown-link">
              welcome：{{username}}<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>修改密码</el-dropdown-item>
              <el-dropdown-item>注销用户</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>
      <el-container>
        <el-aside class="aside">
          <el-menu router>
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span slot="title">导航一</span>
              </template>
              <el-menu-item-group>
                <span slot="title">分组一</span>
                <el-menu-item index="/main/user">选项1</el-menu-item>
                <el-menu-item index="/main/user2">选项2</el-menu-item>
              </el-menu-item-group>
              <el-menu-item-group title="分组2">
                <el-menu-item index="1-3">选项3</el-menu-item>
              </el-menu-item-group>
              <el-submenu index="1-4">
                <span slot="title">选项4</span>
                <el-menu-item index="1-4-1">选项1</el-menu-item>
              </el-submenu>
            </el-submenu>
            <el-menu-item index="2">
              <i class="el-icon-menu"></i>
              <span slot="title">导航二</span>
            </el-menu-item>
            <el-menu-item index="3" disabled>
              <i class="el-icon-document"></i>
              <span slot="title">导航三</span>
            </el-menu-item>
            <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title">导航四</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main class="main">
          <!-- 内容区域 -->
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'Login',
  data() {
    return {username: undefined}
  },
  mounted() {
    this.username = this.$store.state.loginUser
  },
  methods: {}
}
</script>

<style scoped>
.header {
  width: 100%;
  height: 70px;
  background-color: #409eff;
}
.main {
  width: 100%;
  height: 1000px;
  background-color: #e6a23c;
}
.aside {
  width: 200px;
  height: 1000px;
  background-color: #545c64;
}
.logo {
  float: left;
}
.userInfo {
  float: right;
  line-height: 70px;
}
</style>
